package pseudoAssemblerCompiler.twopassassembler.model.codeoperationtable;

import pseudoAssemblerCompiler.twopassassembler.model.assemblerAlgorithms.IViewModel;
import pseudoAssemblerCompiler.twopassassembler.model.entities.OperationCode;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: Администратор
 * Date: 15.04.12
 * Time: 12:11
 * To change this template use File | Settings | File Templates.
 */
public class CodeOperationTableImpl implements ICodeOperationTableModel, IViewModel {

    /**
     * Список команд операций
     */
    private Map<String, OperationCode> _codeOperationMap;

    public CodeOperationTableImpl() {
        _codeOperationMap = new TreeMap<String, OperationCode>();
    }

//    @Override
//    public void firstPass(String s) {
//        //To change body of implemented methods use File | Settings | File Templates.
//    }

    @Override
    public Map<String, OperationCode> getCodeOperationTableElements() {
        return _codeOperationMap;
    }

    @Override
    public void setCodeOperationTable(Map<String, OperationCode> operationCodeMap) {
        _codeOperationMap = operationCodeMap;
    }

    @Override
    public void addCodeOperation(String key, OperationCode operationCode) {
        _codeOperationMap.put(key, operationCode);
    }

    @Override
    public void removeCodeOperation(String key) {
        _codeOperationMap.remove(key);
    }

}
